package com.freewater.library.lending.book.infrastructure.model;

import com.freewater.library.common.domain.Nullable;
import com.freewater.library.lending.book.model.BookInstance;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

// 持久层对领域模型属性扩展（例如乐观锁version字段，单独的数据库id字段）
@Getter
@Setter
public class BookInstanceImpl extends BookInstance {

    private long dbId;

    private int version;

    public BookInstanceImpl(String qrCode, String isbn) {
        super(qrCode, isbn);
    }

    public BookInstanceImpl(String qrCode,
                            String isbn,
                            boolean takenOff,
                            boolean reserved,
                            boolean checkedOut,
                            boolean lost,
                            @Nullable Long reservedBy,
                            @Nullable LocalDateTime reservedAt,
                            @Nullable Long checkedOutBy,
                            @Nullable LocalDateTime checkedOutAt,
                            @Nullable Boolean checkedOutOverdueMarked) {
        super(qrCode, isbn, takenOff, reserved, checkedOut, lost, reservedBy, reservedAt,
                checkedOutBy, checkedOutAt, checkedOutOverdueMarked);
    }
}
